import request from '@/utils/request'

// 终端属性/运营商/新增用户
export function getSelectCarrierNewUserByDate(data) {
  let url = '';
	let baseUrl = `${process.env.VUE_APP_BASE_API}/gmDevice/selectCarrierNewUserByDate?appKey=${data.appKey}&startDate=${data.startDate}&endDate=${data.endDate}`;
	url = baseUrl + (data.channel ? ('&channel=' + data.channel) : ('')) + (data.version ? ('&appVersion=' + data.version) : (''))
  return request({
    url,
    method: 'get',
    headers: {
      'Content-Type': 'x-www-form-urlencoded'
    }
  })
}

// 终端属性/运营商/启动次数
export function getSelectCarrierOpenCountByDate(data) {
  let url = '';
	let baseUrl = `${process.env.VUE_APP_BASE_API}/gmDevice/selectCarrierOpenCountByDate?appKey=${data.appKey}&startDate=${data.startDate}&endDate=${data.endDate}`;
	url = baseUrl + (data.channel ? ('&channel=' + data.channel) : ('')) + (data.version ? ('&appVersion=' + data.version) : (''))
  return request({
    url,
    method: 'get',
    headers: {
      'Content-Type': 'x-www-form-urlencoded'
    }
  })
}

// 终端属性/联网方式/新增用户
export function getSelectWifiNewUserByDate(data) {
  let url = '';
	let baseUrl = `${process.env.VUE_APP_BASE_API}/gmDevice/selectWifiNewUserByDate?appKey=${data.appKey}&startDate=${data.startDate}&endDate=${data.endDate}`;
	url = baseUrl + (data.channel ? ('&channel=' + data.channel) : ('')) + (data.version ? ('&appVersion=' + data.version) : (''))
  return request({
    url,
    method: 'get',
    headers: {
      'Content-Type': 'x-www-form-urlencoded'
    }
  })
}

// 终端属性/联网方式/启动次数
export function getSelectWifiOpenCountByDate(data) {
  let url = '';
	let baseUrl = `${process.env.VUE_APP_BASE_API}/gmDevice/selectWifiOpenCountByDate?appKey=${data.appKey}&startDate=${data.startDate}&endDate=${data.endDate}`;
	url = baseUrl + (data.channel ? ('&channel=' + data.channel) : ('')) + (data.version ? ('&appVersion=' + data.version) : (''))
  return request({
    url,
    method: 'get',
    headers: {
      'Content-Type': 'x-www-form-urlencoded'
    }
  })
}